Since a non-pass-by breakpoint causes interruption of a running program, while pass-by breakpoint not only interrupts the normal running of a program, but also records relevant information when the breakpoint is triggered. Therefore, pass-by breakpoint is usually used in the program debugging technique.
Currently available pass-by breakpoint setting method and program debugging method mainly includes the following.
All of a source program code is backuped in a memory space, an instruction at a breakpoint in the source program code is modified as Break, and an instruction next to the instruction at the breakpoint in the backuped code is modified as Break. Thus, after the Break is executed in the source program code, the process jumps to the backed-up code to cause a second Break, and thereafter jumps back to the source program code and continues to execute program code after the Break in the source program code. Alternatively, an instruction at the breakpoint in the source program code is modified as Break, and after the Break is executed in the source program code, an advanced language is used to manually parse the instruction at the breakpoint. Thereafter, PC++ is used to jump to an instruction next to the Break in the source program code, and the process continues to execute the source program code.
The inventor found during realization of the present invention that existing solutions require relatively much memory space as occupied.